// 1.
interface Product {
    readonly id: number,
    name: string,
    price: number,
    description?: string
}

// 2.
type Add = {
    (a: number, b: number): number;
}
const add: Add = (a: number, b: number): number => {
    return a + b;
}


type Greet = (name?: string) => string;
const greet: Greet = (name?: string) => {
    return name + 'hello';
}
// 4.
interface CreateUser {
    (name: string, age: number): object;
}
const createUser: CreateUser = (name, age) => {
    return { name, age };
}

// 5.
let product1: Array<Product>;
// 6.
interface Func {
    (): void;
}

// 7.
const enum Status {
    off = 'off',
    on = 'on'
}

// 8.
interface User {
    name: string,
    age: number
}
interface Contact {
    email: string,
    phone: string
}
type UserContact = User & Contact